﻿using AiMoBridge.Interface;

namespace AiMoWindows.Entrance.Connect
{
    class PipeExecutor(PipeClient pipe) : IExecutor
    {
        PipeClient CurrentPipe { get; } = pipe;
        string runCommandError = "";
        string runCommandTime = "";
        public string RunCommandError => runCommandError;
        public string RunCommandTime => runCommandTime;
        public bool RunSriptCommand(IExecutorInfo assemblyRunner)
        {
            runCommandError = "";
            runCommandTime = "";
            //App 发起执行
            bool result = CurrentPipe.RunAssembly(assemblyRunner, out string runError, out string runTime);
            runCommandTime = runError;
            runCommandError = runTime;
            return result;
        }
    }
}
